// 06-图1 列出连通集

#include "../base/MGraph-DFS-BFS.c"
#include "../base/MGraph-input.c"

int main() {
    int vn, en;
    scanf("%d %d", &vn, &en);
    MGraph* graph = createGraph(UndirectedGraph, 0, vn);
    readEdgeV0(graph, en);
    // printGraph(graph);
    // printf("\ndfs\n");
    listComponents(graph, DFS);
    // printf("\nbfs\n");
    listComponents(graph, BFS);
    freeGraph(graph);
    return 0;
}
